/**
 * 
 */
package com.vector.ding.commons.util.collection;

import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

/**
 * @author vector
 *
 */
public final class CollectionUtil {

	/**
	 * @param collection
	 * @return null or empty cllection
	 */
	public static boolean isEmpty(Collection<?> collection) {
		return collection != null ? collection.isEmpty() : true;
	}
	
	/**
	 * 获得set集合
	 * @param elements
	 * @return
	 */
	public static <T> Set<T> asSet(T... elements) {
		Set<T> set = new HashSet<T>(Arrays.asList(elements));
		return set;
	}

	public static boolean isNotEmpty(Collection<?> collection) {
		return ! isEmpty(collection);
	}
}
